/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sgii;

import java.sql.Connection;
import java.sql.DriverManager;
import loaders.XMLoader;




/**
 *
 * @author Franco
 */
public class SGII {

    private final String URL = "jdbc:sqlserver://FRANCO-NOTEBOOK\\SQLSERVER2008R2;databaseName=sgii";
    private final String USERNAME = "sa";
    private final String PASSWORD = "sqlpsiserver";
    
    public static Connection connection = null;
    
    public SGII(){
        try{
            connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
            // Get a statement from the connection            
            XmlReader.GetClients("C:\\Users\\Franco\\Documents\\Facu\\Sistemas de Gestion II\\TP2\\Customer_R.xml", "Customers","R");
            XmlReader.GetClients("C:\\Users\\Franco\\Documents\\Facu\\Sistemas de Gestion II\\TP2\\Customer_W.xml", "Customers","W");
            XlsReader.GetrEmployeeRecords("C:\\Users\\Franco\\Documents\\Facu\\Sistemas de Gestion II\\TP2\\Employee.xls");
            cleanTables();
            populateTables();
            createMainTable();
            showView();
        } catch(Exception e){
            System.out.println(e);
        }
        
    }
        
    private void populateTables() throws Exception{
        loadXMLFiles();
    }

    private void loadXMLFiles() throws Exception{        
        XMLoader xmlLoader = new XMLoader("C:\\Users\\Franco\\Documents\\Facu\\Sistemas de Gestion II\\TP2\\Customer_R.xml");
	 xmlLoader.doMagic();
    }
    
    
    
    private void cleanTables() {
        
    }
    
    private void createMainTable() {
        
    }

    private void showView() {
        
    }
    
    public static void main(String[] args) {
        SGII sgii = new SGII();
    }

    
    
    
}
